#include "Announce.h"

#include <sstream>
#include <Poco/DOM/Document.h>
#include <Poco/DOM/NodeIterator.h>
#include "misc/Interface.h"
#include "misc/Debug.h"
#include "nameserver/NameServer.h"
/*********************************************************/
void Announce::execute()
{
	// This message should only be SENT by the nameserver, so we don't do anything
}
/*********************************************************/
std::string Announce::serialize() const
{
	NameServer& ns = NameServer::Instance();
	std::ostringstream		ostr;
	id = ns.getID();

	ostr << "<GS id='" << id << "'>";
	ostr << "<Announce>" << addr << "</Announce>";
	ostr << "</GS>";

	return( ostr.str() );
}
/*********************************************************/
void Announce::deserialize(Poco::XML::NodeIterator& it)
{
	// This messages doesn't carry any specific data so we do nothing here
}
/*********************************************************/
void Announce::setAddress(const std::string& addr)
{
	Announce::addr = addr;
}
/*********************************************************/
